

#include "map.h"
#include "game.h"

int main()
{
	//begin
	char input = 0;
	/*int lastTime = clock(), now, updateRate = 100;*/
	Game g;
	g.gameInit();
	//middle
	while(input != 27)
	{
		if(!kbhit())
		{
			/*now = clock();*/
			g.update(/*now-lastTime*/);
			/*lastTime = now;*/

			g.draw();

			while(!kbhit() /*&& clock() < now+updateRate*/)
			{
				Sleep(1);
			}
		}
		else
		{
			input = getch();
			g.handleInput(input);
		}
	}
	//end
	g.releaseMap();

	gotoxy(0, 18);
	cout << "Bye. (^^)" << endl;
	return 0;
}